﻿function moneyrange(value, element, param) {
    return Number(value) % 100 == 0 && Number(value) > 0;
}

jQuery.validator.addMethod("moneyrange", moneyrange, "借款金额必须是100的倍数.");

function TraceMoney()
{
    var money = $('#Amount').val();
    var interestRate = $('#InterestRate').val();
    var LoanPeriod = $('#LoanPeriod').val();
    if (Number(money) > 0) {
        var totalRepaymentValue = TotalRepaymentAmountCompute(interestRate, LoanPeriod, Number(money));

        $('#cartTotalAmt').html(money);
        $('#expertAmount').html(totalRepaymentValue-Number(money));
    }
    else
    {
        $('#cartTotalAmt').html("正在计算...");
        $('#expertAmount').html("正在计算...");
    }
}

$(document).ready(function () {
    TraceMoney();
    $('#Amount').change(TraceMoney);

    $('#bid_conformation_btn').click(function () {
        $('form').submit();
    });
});